package ten;

import java.util.*;

public class 十十二任务调度 {
    public static void main(String[] args) {
        Timer timer = new Timer();
//        timer.schedule(new MyTask(), 1000);
//        timer.schedule(new MyTask(), 1000, 1000);
        Calendar cal = new GregorianCalendar(2019, 4, 20, 13, 7, 0);
        timer.schedule(new MyTask(), cal.getTime(), 1000);

        //复杂的用 quartz 的工具包
    }
}

class MyTask extends TimerTask {

    @Override
    public void run() {
        for (int i = 0; i < 10; i++) {
            System.out.println("take it easy");
        }
        System.out.println("-------end-------");
    }
}